Markdown 换行语法

您所在的位置:网站首页 vscode markdown引用块不生效 Markdown 换行语法

Markdown 换行语法

2024-07-09 17:09| 来源: 网络整理| 查看: 265

# Markdown 换行语法

在一行的末尾添加两个或多个空格,然后按回车键,即可创建一个换行()。

Markdown语法 HTML 预览效果 This is the first line.   And this is the second line.

This is the first line. And this is the second line.

This is the first line. And this is the second line.

# 换行(Line Break)用法的最佳实践

几乎每个 Markdown 应用程序都支持两个或多个空格进行换行,称为 结尾空格(trailing whitespace) 的方式,但这是有争议的,因为很难在编辑器中直接看到空格,并且很多人在每个句子后面都会有意或无意地添加两个空格。由于这个原因,你可能要使用除结尾空格以外的其它方式来换行。幸运的是,几乎每个 Markdown 应用程序都支持另一种换行方式:HTML 的 标签。

为了兼容性,请在行尾添加“结尾空格”或 HTML 的 标签来实现换行。

还有两种其他方式我并不推荐使用。CommonMark 和其它几种轻量级标记语言支持在行尾添加反斜杠 (\) 的方式实现换行,但是并非所有 Markdown 应用程序都支持此种方式,因此从兼容性的角度来看,不推荐使用。并且至少有两种轻量级标记语言支持无须在行尾添加任何内容,只须键入回车键(return)即可实现换行。

✅  Do this ❌  Don't do this First line with two spaces after.   And the next line.

First line with the HTML tag after. And the next line.

First line with a backslash after.\ And the next line.

First line with nothing after. And the next line.

← Markdown 段落语法 Markdown 强调语法 →



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3